package com.application.lucky.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.converter.PropertyConverter;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.greenrobot.greendao.annotation.Generated;

@Entity
public class UserBean {


    /**
     * userId : 1
     * userType : 2
     * surfing : 100124
     * nickName : 100124
     * userDesc : 111
     * sex : 0
     * headPic :
     * birthday : 1111
     * city : 1111
     * lastActiveTime : 1111
     * online : false
     * creditLevel : 0
     * inRoom : false
     * loginId : 0
     * mobile : 11111
     * showName:guoqing
     * professional :
     * gisX : 1111
     * gisY : 111
     * createTime : 1569592459000
     * integrity : 0
     * picList : ["11111"]
     * setting : {"pushAddFriend":true,"pushFriendMessage":true,
     * "pushSystem":true,"pushFollow":true,"userFisrtJoinTips":true,
     * "onlineHidden":false,"track":false,"disturb":false}
     */
    @Id
    private Long userId;
    private int userType;
    private int surfing;
    private String nickName;
    private String userDesc;
    private int sex;
    private String headPic;
    private String birthday;
    private String city;
    private String lastActiveTime;
    private boolean online;
    private int creditLevel;
    private boolean inRoom;
    private int loginId;
    private String mobile;
    private String professional;
    private String gisX;
    private String gisY;
    private long createTime;
    private int integrity;
    public boolean isAdd;
    private String bank;
    private String bankName;
    private String name;
    private String bankAddress;
    private String showName;
    private String realName;

    @Convert(columnType = String.class, converter = StringConverter.class)
    private List<String> picList;

    public String getBank() {
        return bank;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBankAddress() {
        return bankAddress;
    }

    public void setBankAddress(String bankAddress) {
        this.bankAddress = bankAddress;
    }

    @Generated(hash = 1203313951)
    public UserBean() {
    }

    @Generated(hash = 1678934995)
    public UserBean(Long userId, int userType, int surfing, String nickName, String userDesc, int sex, String headPic, String birthday, String city, String lastActiveTime, boolean online,
            int creditLevel, boolean inRoom, int loginId, String mobile, String professional, String gisX, String gisY, long createTime, int integrity, boolean isAdd, String bank,
            String bankName, String name, String bankAddress, String showName, String realName, List<String> picList) {
        this.userId = userId;
        this.userType = userType;
        this.surfing = surfing;
        this.nickName = nickName;
        this.userDesc = userDesc;
        this.sex = sex;
        this.headPic = headPic;
        this.birthday = birthday;
        this.city = city;
        this.lastActiveTime = lastActiveTime;
        this.online = online;
        this.creditLevel = creditLevel;
        this.inRoom = inRoom;
        this.loginId = loginId;
        this.mobile = mobile;
        this.professional = professional;
        this.gisX = gisX;
        this.gisY = gisY;
        this.createTime = createTime;
        this.integrity = integrity;
        this.isAdd = isAdd;
        this.bank = bank;
        this.bankName = bankName;
        this.name = name;
        this.bankAddress = bankAddress;
        this.showName = showName;
        this.realName = realName;
        this.picList = picList;
    }

    public int getUserType() {
        return userType;
    }

    public void setUserType(int userType) {
        this.userType = userType;
    }

    public int getSurfing() {
        return surfing;
    }

    public void setSurfing(int surfing) {
        this.surfing = surfing;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getShowName() {
        return showName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }

    public String getUserDesc() {
        return userDesc;
    }

    public void setUserDesc(String userDesc) {
        this.userDesc = userDesc;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getHeadPic() {
        return headPic;
    }

    public void setHeadPic(String headPic) {
        this.headPic = headPic;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getLastActiveTime() {
        return lastActiveTime;
    }

    public void setLastActiveTime(String lastActiveTime) {
        this.lastActiveTime = lastActiveTime;
    }

    public boolean isOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public int getCreditLevel() {
        return creditLevel;
    }

    public void setCreditLevel(int creditLevel) {
        this.creditLevel = creditLevel;
    }

    public boolean isInRoom() {
        return inRoom;
    }

    public void setInRoom(boolean inRoom) {
        this.inRoom = inRoom;
    }

    public int getLoginId() {
        return loginId;
    }

    public void setLoginId(int loginId) {
        this.loginId = loginId;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getProfessional() {
        return professional;
    }

    public void setProfessional(String professional) {
        this.professional = professional;
    }

    public String getGisX() {
        return gisX;
    }

    public void setGisX(String gisX) {
        this.gisX = gisX;
    }

    public String getGisY() {
        return gisY;
    }

    public void setGisY(String gisY) {
        this.gisY = gisY;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public int getIntegrity() {
        return integrity;
    }

    public void setIntegrity(int integrity) {
        this.integrity = integrity;
    }



    public List<String> getPicList() {
        return picList;
    }

    public void setPicList(List<String> picList) {
        this.picList = picList;
    }

    public boolean getOnline() {
        return this.online;
    }

    public boolean getInRoom() {
        return this.inRoom;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }





    public Long getUserId() {
        return this.userId;
    }





    public void setUserId(Long userId) {
        this.userId = userId;
    }





    public boolean getIsAdd() {
        return this.isAdd;
    }





    public void setIsAdd(boolean isAdd) {
        this.isAdd = isAdd;
    }

    

    public static class StringConverter implements PropertyConverter<List<String> , String>{


        @Override
        public List<String> convertToEntityProperty(String databaseValue) {
            if (databaseValue == null) {
                return null;
            }
            else {
                List<String> list = Arrays.asList(databaseValue.split(","));
                return list;
            }
        }

        @Override
        public String convertToDatabaseValue(List<String> entityProperty) {
            if(entityProperty==null){
                return null;
            }
            else{
                StringBuilder sb= new StringBuilder();
                for(String link:entityProperty){
                    sb.append(link);
                    sb.append(",");
                }
                return sb.toString();
            }
        }
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "userId=" + userId +
                ", userType=" + userType +
                ", surfing=" + surfing +
                ", nickName='" + nickName + '\'' +
                ", userDesc='" + userDesc + '\'' +
                ", showName='" + showName + '\'' +
                ", sex=" + sex +
                ", headPic='" + headPic + '\'' +
                ", birthday='" + birthday + '\'' +
                ", city='" + city + '\'' +
                ", lastActiveTime='" + lastActiveTime + '\'' +
                ", online=" + online +
                ", creditLevel=" + creditLevel +
                ", inRoom=" + inRoom +
                ", loginId=" + loginId +
                ", mobile='" + mobile + '\'' +
                ", professional='" + professional + '\'' +
                ", gisX='" + gisX + '\'' +
                ", gisY='" + gisY + '\'' +
                ", createTime=" + createTime +
                ", integrity=" + integrity +
                ", isAdd=" + isAdd +
                ", bank='" + bank + '\'' +
                ", bankName='" + bankName + '\'' +
                ", name='" + name + '\'' +
                ", bankAddress='" + bankAddress + '\'' +
                ", picList=" + picList +
                '}';
    }

    public String getRealName() {
        return this.realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }
}
